/*
 Navicat Premium Data Transfer

 Source Server         : LocalDB
 Source Server Type    : SQL Server
 Source Server Version : 15004153
 Source Host           : (localdb)\MSSQLLocalDB:1433
 Source Catalog        : OcelotSettings
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 15004153
 File Encoding         : 65001

 Date: 07/07/2023 17:31:17
*/


-- ----------------------------
-- Table structure for RouteProperty
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[RouteProperty]') AND type IN ('U'))
	DROP TABLE [dbo].[RouteProperty]
GO

CREATE TABLE [dbo].[RouteProperty] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Key] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Value] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [RouteId] int  NOT NULL,
  [Type] int  NOT NULL
)
GO

ALTER TABLE [dbo].[RouteProperty] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键Id',
'SCHEMA', N'dbo',
'TABLE', N'RouteProperty',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'路由Id',
'SCHEMA', N'dbo',
'TABLE', N'RouteProperty',
'COLUMN', N'RouteId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'路由属性表',
'SCHEMA', N'dbo',
'TABLE', N'RouteProperty'
GO


-- ----------------------------
-- Auto increment value for RouteProperty
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[RouteProperty]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table RouteProperty
-- ----------------------------
ALTER TABLE [dbo].[RouteProperty] ADD CONSTRAINT [PK__RoutePro__3214EC079C16F576] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Foreign Keys structure for table RouteProperty
-- ----------------------------
ALTER TABLE [dbo].[RouteProperty] ADD CONSTRAINT [idx_route_routeproperty_routeId] FOREIGN KEY ([RouteId]) REFERENCES [dbo].[Route] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

